<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */
    
    /*********************************************************
    *            --== itellico Net Architect ==--
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @since 21.09.2005
    * @copyright itellico.com 2005
    *
    *********************************************************/
    
    /***
    * Class adminNodeIfolder
    ****
    * This class handles the editing of folders
    ****
    * @package adminNodes
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @since 21.09.2005
    * @copyright itellico.com 2005
    ***/
    class adminNodeIsearch extends adminNode{
        
        function process(){
            if($_POST){
                //update database record
                $this->db->Execute("UPDATE node_inserat_folder SET content = '".addslashes($_POST['content'])."' WHERE id = " . $this->object);
                
                //updates the status of the page (title, wf state)
                $this->updateNodeStatus();
                
                //make a note of the ajax request
                $this->log->recordAction("Updated Inserat Search Folder (".$this->object.") with global id (".$this->noderef.")");
            
                header('Location: '.$this->request.'&confirm=true');
                exit;
            }else{
                $this->smarty->assign('node',$this->db->getRow("SELECT 
                                                                    objectmap.title, 
                                                                    content 
                                                                FROM objectmap
                                                                LEFT JOIN node_inserat_folder ON objectmap.objectid = node_inserat_folder.id 
                                                                WHERE version = 1 AND objectmap.nodeid = " . $this->noderef));
            }
        }
        
        
        function setTemplate(){
            $this->setActionTemplate('nodes/editIsearch.html');
        }
        
        function addInstance(){
            $this->db->Execute("INSERT INTO node_inserat_folder(content) VALUES('')");
            return $this->db->getOne("SELECT last_value FROM node_inserat_folder_id_seq");
        }
    }
?>